home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SOUND.SWG / 0023_Control Speaker.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-17  |  3KB  |  93 lines

  1. ===========================================================================
  2.  BBS: Canada Remote Systems
  3. Date: 07-11-93 (13:22)             Number: 30113
  4. From: STEVE WIERENGA               Refer#: NONE
  5.   To: TRAVIS GRIGGS                 Recvd: NO  
  6. Subj: SPEAKER(OFF)                   Conf: (1221) F-PASCAL
  7. ---------------------------------------------------------------------------
  8. Hello Travis:
  9.  
  10.  >> { untested, but should work }
  11.  >> {$M 1024,0,0}
  12.  >> {$F+}
  13.  >> uses DOS;
  14.  >> Var
  15.  >>   Old1C : Procedure;
  16.  TG>
  17.  >> Procedure SpeakerOff; Interrupt;
  18.  >> Begin
  19.  >>     ASM { no sound proc, removes need to use CRT unit in a TSR }
  20.  >>       mov dx,061h
  21.  >>       in al,dx
  22.  >>       and al,11111100b
  23.  >>       out dx,al
  24.  >>       pushf
  25.  >>     End;
  26.  >>     Old1C;
  27.  >> End;
  28.  TG>
  29.  >> Begin
  30.  >>   GetIntVec ($1C,@Old1C);
  31.  >>   SetIntVec ($1C,@SpeakerOff);
  32.  >>   Keep(0);
  33.  >> End.
  34.  TG>
  35.  TG> I'm trying to learn to write a TSR.  Could you explain every step and
  36.  TG> why it's there?  Thanks...
  37.  
  38. I didn't write that code, actually.  I have never written a TSR and don't plan
  39. to in the near future, so I suggest you ask one of the gurus here.
  40.  
  41.  >> --- FMail 0.90
  42.  TG>
  43.  TG> Fmail 0.94 is out.  You should get it.  It's much better...
  44.  
  45. I'm still with .90 because I can't afford to register .94 (.90 doesn't have a
  46. registration) :-(.
  47. Take Care, Steve
  48. Shockwave Software Systems
  49.  
  50. --- FMail 0.90
  51.  * Origin: The Programmer's Armpit... Home of Monsoon*Qomm! (1:2613/228.2)
  52. ===========================================================================
  53.  BBS: Canada Remote Systems
  54. Date: 07-10-93 (11:08)             Number: 30157
  55. From: STEVEN TALLENT               Refer#: NONE
  56.   To: NIELS LANGKILDE               Recvd: NO  
  57. Subj: RE: SPEAKER(OFF)               Conf: (1221) F-PASCAL
  58. ---------------------------------------------------------------------------
  59.  -=> Quoting Niels Langkilde to Everyone <=-
  60.  
  61.  NL> Is it possible to diable/enable the speaker output (alternatvly
  62.  NL> redirect it) ?? If so, please help !
  63.  
  64. The only thing that can be done is disabling the speaker many times
  65. a second to do it.  Here's some code that disables it 18 times a second,
  66. but notably does NOT work with programs that shut down interrupts
  67. during playback.
  68.  
  69. {$M 1024,0,0}
  70. {$N-,S-,G+} { Use g- for 8088 systems, g+ for V20 and above }
  71. PROGRAM NoSpeak;
  72. USES Dos;
  73. VAR OLDINT1C : Procedure;
  74.  
  75. PROCEDURE ShutOff; INTERRUPT;
  76. BEGIN
  77.   Port [97] := Port[97] and 253; {Turn off speaker}
  78.   OldInt1C;
  79.   end;
  80.  
  81. BEGIN
  82.   GetIntVec($1C, @OldInt1C);
  83.   SetIntVec($1C, @ShutOff);
  84.   Keep(0);
  85.   end.
  86.  
  87. Note this is a TSR, and I can't guarantee that it'll work right on
  88. anyone's computer.
  89.  
  90. ___ Blue Wave/QWK v2.12
  91. --- Renegade v06-25 Beta
  92.  * Origin: Pink's Place  (409)883-8344 735-3712 (1:3811/210)
  93.